<?php
require_once 'modules/home/const.inc';
class Helper_Wall extends Zend_Controller_Action_Helper_Abstract
{
    public function getTopic($receive_id, $type = 0, $page = 0) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        $list_wall = $wallModel->get_receive_root_wall($receive_id, $type, $page);

        return $list_wall;
    }

    public function getReply($parent_arr = array(), $type = 0) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        $list_wall = $wallModel->get_reply_wall($parent_arr, $type);

        return $list_wall;
    }
    
    public function countWall($receive_id, $type = 0) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        $count_wall = $wallModel->count_wall($receive_id, $type);

        return $count_wall;
    } 
    
    public function deleteWall($receive_id, $id, $type) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        return $wallModel->delete_wall($receive_id, $id, $type);
    }
    
    public function insertWall($receive_id, $send_id, $content, $topic, $type) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        return $wallModel->insert_wall($receive_id, $send_id, $content, $topic, $type);
    }
    
    public function getWall($id) {
        $wallModel = AppGlobal::loadModel('Wall', 'home');
        return $wallModel->get_wall_info($id);
    }                
}

